
import React,{useState,useEffect}from 'react'

export default function useScore(score:number) {

    const [level, setLevel] = useState("不及格");

     useEffect(() => {
        if(score<60){
            setLevel("不及格");
        }else if(score<70){
            setLevel("及格")
        }else if(score<80){
            setLevel("良好")
        }else{
            setLevel("优秀")    
        }
        

     }, [score]);

    return  level;
    

}
